package com.wwy.monitor.exception;

public class BizException extends RuntimeException {
    private static final long serialVersionUID = 8812750197095779487L;
    private final int httpCode;
    private final String errorMsg;
    private final int errorCode;

    public BizException(int errorCode, String errorMsg) {
        this(errorCode, errorMsg, 200);
    }

    public BizException(IBizException bizException) {
        this(bizException.code(), bizException.message(), 200);
    }

    public BizException(IBizException bizException, int httpCode) {
        this(bizException.code(), bizException.message(), httpCode);
    }

    public BizException(int errorCode, String errorMsg, int httpCode) {
        this.httpCode = httpCode;
        this.errorMsg = errorMsg;
        this.errorCode = errorCode;
    }

    public int getHttpCode() {
        return this.httpCode;
    }

    public String getErrorMsg() {
        return this.errorMsg;
    }

    public int getErrorCode() {
        return this.errorCode;
    }
}
